/* index.css - 首页特定样式 */

/* 标签页样式 */
.dashboard-tab {
  flex: 1;
  min-width: fit-content;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #6b7280;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.dashboard-tab:hover {
  color: var(--color-primary);
  background: rgba(45, 106, 79, 0.05);
}

.dashboard-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: rgba(45, 106, 79, 0.05);
  font-weight: 600;
}

.dashboard-tab i {
  font-size: 1.1rem;
}

/* 标签页内容 */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 移动端标签页优化 */
@media (max-width: 640px) {
  .dashboard-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .dashboard-tab span {
    display: none;
  }

  .dashboard-tab i {
    margin-right: 0 !important;
    font-size: 1.25rem;
  }
}

/* 自适应网格布局 */
.auto-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.auto-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 1.5rem;
}

/* 移动端布局优化 */
@media (max-width: 768px) {
  #game-navbar {
    margin-bottom: 0; /* 移除额外空间，因为移动端状态栏已被移除 */
  }

  /* 主内容区域适配 */
  main {
    padding-top: 10px; /* 减少顶部填充，因为状态栏已被移除 */
  }

  /* 资源卡片在移动端堆叠显示 */
  .grid.grid-cols-1.md\:grid-cols-3 {
    gap: 0.75rem;
  }

  /* 快捷操作在移动端优化间距 */
  .grid.grid-cols-2 {
    gap: 0.5rem;
  }

  /* 移动端减少面板内边距 */
  .bg-white.rounded-xl.shadow-md {
    padding: 1rem;
  }

  /* 2列布局在移动端自动堆叠 */
  .grid.grid-cols-1.md\:grid-cols-2 {
    gap: 1rem;
  }
}

/* 资源卡片样式 */
.resource-card {
  padding: 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--radius-lg);
}

.resource-icon {
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

/* 建筑卡片样式 */
.building-card {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem;
  transition: all 0.3s ease;
}

.building-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 可升级建筑标记 */
.building-upgradable::after {
  content: "!";
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--color-danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
}

/* 进度条样式 */
.progress-bar {
  height: 8px;
  background-color: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
}

/* 事件卡片样式 */
.event-card {
  padding: 1rem;
  background-color: var(--color-light);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-lg);
}

/* 事件选项按钮 */
.event-option {
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  width: 100%;
  text-align: left;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.event-option:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* 事件徽章样式 */
.event-badge {
  background-color: #ff4500;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.75rem;
  position: relative;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* 日志区域样式 */
#event-log {
  height: 160px;
  font-size: 0.875rem;
  background-color: var(--color-light);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  overflow-y: auto;
}

/* 折叠面板 */
.collapsible-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.collapsible-content.collapsed {
  max-height: 0;
}
